<template>
  <div>
    <el-dialog
      title="审核流程"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      width="1000px"
      :lock-scroll="false"
    >
      <el-empty v-show="!tableData.length" description="暂无数据"></el-empty>
      <Flow v-if="dialogVisible && tableData.length" :tableData="tableData" />
    </el-dialog>
  </div>
</template>
<script>
import { flowApiQueryCurrentFlowInfo } from '@/api/admin/audit/flowApi.js'
export default {
  components: {
    Flow: () => import('./flow.vue'),
  },
  data() {
    return {
      dialogVisible: false,
      listQuery: {
        businessKey: '',
      },
      tableData: [],
    }
  },
  mounted() {
    this.$bus.$on('showDialogFlowInfo', (row) => {
      this.listQuery.businessKey = row.businessKey
      this.getList()
    })
  },
  beforeDestroy() {
    this.$bus.$off('showDialogFlowInfo')
  },
  methods: {
    getList() {
      flowApiQueryCurrentFlowInfo(this.listQuery).then((res) => {
        this.tableData = res.data.data
        this.dialogVisible = true
      })
    },
  },
}
</script>